{% extends "base.volt" %}
 		{% block pageHeader %}
        {{ stylesheet_link("/assets/manage/css/tabstyle.css", false) }}
        {% endblock %}
{% block pageFooter%}
{{ javascript_include("/js/area.js", false) }}
{{ javascript_include("/assets/manage/js/bp/list.js", false) }}
{% endblock %}

{% block content %}
{{ partial("module/left_bp") }}
<div class="col-xs-10">
    <ol class="breadcrumb">
        <li><a href="{{ url.get('bp/list') }}">美容院</a></li>
        <li><a href="{{ url.get('bp/list') }}">美容院管理</a></li>
        <li class="active">列表</li>
    </ol>
    <div class="commtable">
    	<ul>	
    		<li {% if filterState == -10000 %} class="hover" {% endif %}><a href="{{ url.get('bp/list') }}">全部</a></li>
    		<li {% if filterState == 1 %} class="hover" {% endif %}><a href="{{ url.get('bp/list?filterState=1') }}" >正常</a></li>
    		<li {% if filterState == 0 %} class="hover" {% endif %}><a href="{{ url.get('bp/list?filterState=0') }}">待发布</a></li>
    		<li {% if filterState == -1 %} class="hover" {% endif %}><a href="{{ url.get('bp/list?filterState=-1') }}">已删除</a></li>
    		
    	</ul>
    </div>
    <div style="clear:both;"></div>
    <div class="panel panel-default">
        <div class="panel-body">
            <form class="form-inline" role="form" action="" method="get">
                <div class="form-group">
	                <!-- <div class="form-group">
	                    <div class="input-group">
	                        <label class="input-group-addon" for="filterState">状态:</label>
	                        <select class="form-control" name="filterState" id="filterState">
	                            <option value="-10000" {{ filterState == -10000 ? 'selected="selected"' : '' }} >全部</option>
	                            {% for k, v in bpStateList %}
	                            <option value="{{ k }}" {{ filterState == k ? 'selected="selected"' : '' }} >{{ v }}</option>
	                            {% endfor %}
	                        </select>
	                    </div>
	                </div> -->
	                <input type="hidden" name="filterState" value="{{ filterState }}">
                    <div class="input-group">
                        <label class="input-group-addon" for="filterName">店铺名称:</label>
                        <input class="form-control" type="text" name="filterName" id="filterName" value="{{ filterName|escape_attr }}" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="input-group">
                        <label class="input-group-addon">省</label>
                        <select class="form-control" name="filterProvince" id="filterProvince" dvalue="{{ filterProvince|escape_attr }}">
                            <option value="">全部</option>
                        </select>
                        <label class="input-group-addon">市</label>
                        <select class="form-control" name="filterCity" id="filterCity" dvalue="{{ filterCity|escape_attr }}">
                            <option value="">全部</option>
                        </select>
                        <label class="input-group-addon">区/县</label>
                        <select class="form-control" name="filterDistrict" id="filterDistrict" dvalue="{{ filterDistrict }}">
                            <option value="-10000">全部</option>
                        </select>
                    </div>
                </div>
                
                <!-- <div class="form-group">
                    <div class="input-group">
                        <label class="input-group-addon" for="filterSell">是否销售:</label>
                        <select class="form-control" name="filterSell" id="filterSell">
                            <option value="-10000" {{ filterSell == -10000 ? 'selected="selected"' : '' }}>全部</option>
                            <option value="1" {{ filterSell == 1 ? 'selected="selected"' : '' }}>是</option>
                            <option value="0" {{ filterSell == 0 ? 'selected="selected"' : '' }}>否</option>
                        </select>
                    </div>
                </div> -->
                <div class="form-group">
                    <div class="input-group">
                        <label class="input-group-addon" for="filterMedal">勋章:</label>
                        <select class="form-control" name="filterMedal" id="filterMedal">
                            <option value="-10000" {{ filterMedal == -10000 ? 'selected="selected"' : '' }}>全部</option>
                            <option value="1" {{ filterMedal == 1 ? 'selected="selected"' : '' }}>退款保障</option>
                            <option value="2" {{ filterMedal == 2 ? 'selected="selected"' : '' }}>深度验店</option>
                            <option value="3" {{ filterMedal == 3 ? 'selected="selected"' : '' }}>退款保障 + 深度验店</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary"><i class="fa fa-filter"></i> 搜 索</button>
                </div>
            </form>
        </div>
    </div>

    <table class="table table-hover">
        <thead>
        <tr>
            <th style="width: 60px;">ID</th>
            <th style="width: 100px;">封面</th>
            <th>名称</th>
            <th style="width: 150px;">城区</th>
            <th style="width: 60px;">是否<br />销售</th>
            <th style="width: 60px;">退款<br />保障</th>
            <th style="width: 60px;">深度<br />验店</th>
            <th style="width: 60px;">状态</th>
            <th style="width: 180px;"></th>
        </tr>
        </thead>
        {% for d in bpList %}
        <tr>
            <td>{{ d.bp_id }}</td>
            <td><img src="{{ PicUrlBPCover(d.bp_cover, this.di) }}@!90" /></td>
            <td>{{ d.bp_name|e }}</td>
            <td>{{ d.district }}</td>
            <td>{{ d.bp_is_sell == 1 ? '是' : '否' }}</td>
            <td>{{ BPMedalRefund(d.bp_medal) == 1 ? '是' : '否' }}</td>
            <td>{{ BPMedalVerify(d.bp_medal) == 1 ? '是' : '否' }}</td>
            <td>{{ BPStateValue2Str(d.bp_state) }}</td>
            <td>
                <div class="dropdown">
                    <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu{{ d.bp_id }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><i class="fa fa-cogs"></i> 操作 <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" aria-labelledby="dropdownMenu{{ d.bp_id }}">
                        <li><a href="/frontend/share/beautyParlorPreview?id={{ d.bp_id }}" target="_blank"><i class="fa fa-eye fa-fw"></i> 预览</a></li>
                        <li><a class="but_service_list" dhref="{{ url.get('bpservice/list', ['id': d.bp_id]) }}" dtitle="{{ d.bp_name|escape_attr }}" href="javascript:void(0)"><i class="fa fa-heart fa-fw"></i> 服务项目管理</a></li>
                        <li><a href="javascript:void(0)" dhref="{{ url.get('bpcomment/list', ['id': d.bp_id]) }}" class="but_comment_list" dtitle="{{ d.bp_name|escape_attr }}"><i class="fa fa-comments fa-fw"></i> 评论管理</a></li>
                        <li><a class="but_interact_list" dhref="{{ url.get('bpinteract/list', ['id': d.bp_id]) }}" dtitle="{{ d.bp_name|escape_attr }}" href="javascript:void(0)"><i class="fa fa-heart fa-fw"></i> 美粒互动</a></li>
                        <li><a href="{{ url.get('bp/bannerBpAdd', ['id': d.bp_id]) }}" dhref=""  ><i class="fa fa-comments fa-fw"></i> 推荐到首页</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="{{ url.get('bp/update', ['id': d.bp_id]) }}"><i class="fa fa-pencil fa-fw"></i> 更新基础信息</a></li>
                        {% if d.bp_state == 0 %}
                        <li><a href="javascript:void(0)" dhref="{{ url.get('bp/setState') }}" did="{{ d.bp_id }}" dstate="1" class="bp_set_state"><i class="fa fa-paper-plane-o fa-fw"></i> 发 布</a></li>
                        {% endif %}
                        {% if d.bp_state == 1 %}
                        <li><a href="javascript:void(0)" dhref="{{ url.get('bp/setState') }}" did="{{ d.bp_id }}" dstate="-1" class="bp_set_state"><i class="fa fa-trash-o fa-fw"></i> 删 除</a></li>
                        {% endif %}
                        {% if d.bp_state == -1 %}
                        <li><a href="javascript:void(0)" dhref="{{ url.get('bp/setState') }}" did="{{ d.bp_id }}" dstate="0" class="bp_set_state"><i class="fa fa-reply fa-fw"></i> 恢 复</a></li>
                        {% endif %}
                    </ul>
                </div>
            </td>
        </tr>
        {% endfor %}
    </table>

    {{ this.tagNav.page(
        page,
        total,
        limit,
        url.get('bp/list', [
            'filterName': filterName,
            'filterProvince': filterProvince,
            'filterCity': filterCity,
            'filterDistrict': filterDistrict,
            'filterState': filterState,
            'filterSell': filterSell,
            'filterMedal': filterMedal,
            'page': '__PAGE__'
        ]
    )) }}

</div>

{% endblock %}